home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / rpsort.zip / EXAMPLES.DOC next >
Text File  |  1991-09-17  |  34KB  |  754 lines

  1.  
  2.  
  3.   September 17, 1991           RPSORT Examples                       Page   i
  4.  
  5.                               Table of Contents
  6.                               -----------------
  7.  
  8.   Suggestion On How To Use This Document                                    1
  9.   General Rules For Entry Of Parameters                                     1
  10.   Cautionary Note On Specifying The Output File To RPSORT                   1
  11.  
  12.   Examples That Could Be Executed By The DOS SORT                           2
  13.     1. RPSORT As A Filter                                                   2
  14.     2. Sending Output To The Screen                                         2
  15.     3. Specifying A Sort Key                                                2
  16.     4. Reverse (Descending) Sort                                            2
  17.     5. Using Pipes With RPSORT.                                             2
  18.  
  19.   Examples Of General Interest                                            3-8
  20.     6. Using RPSORT Not As A Filter                                         3
  21.     7. Fixed Length Records                                                 3
  22.     8. Multiple Input Files                                                 3
  23.     9. ASCII (Case Sensitive) Sort                                          3
  24.    10. Reverse (Descending) Sort                                            3
  25.    11. Reverse ASCII Sort                                                   4
  26.    12. Specifying Key Length                                                4
  27.    13. Specifying Key Length But No Start Column                            4
  28.    14. Multiple Sort Keys                                                   4
  29.    15. Another Example Of Multiple Sort Keys                                4
  30.    16. Sort DIR Listing With Multiple Sort Keys                             5
  31.    17. Make ASCII Sequence The Default                                      5
  32.    18. Make Reversed (Descending) Sort The Default                          5
  33.    19. Make Both ASCII And Reversed The Default                             6
  34.    20. Delete Null Lines                                                    6
  35.    21. Delete Lines/Records With Duplicate Keys                             6
  36.    22. Delete Lines/Records If They Are Completely Identical                6
  37.    23. Specify Drive For Temporary Files                                    6
  38.    24. Ignore Ctrl-Z And Use The Entire File                                7
  39.    25. Suppress Copyright And Successful Completion Messages                7
  40.    26. Put Error Messages In A File                                         7
  41.    27. Suppress Copyright Message And Put Error Messages In A File          7
  42.    28. Tell RPSORT To Ignore Any Ctrl-Break From The Keyboard               7
  43.    29. Expanding Tabs In A File                                             8
  44.  
  45.   Examples Of Special Interest To Computer Programmers                   9-11
  46.    30. C Language String As Sort Key                                        9
  47.    31. Mixing C Language Strings And Regular Strings                        9
  48.    32. Turbo Pascal String As Sort Key                                      9
  49.    33. Mixing Turbo Pascal Strings And Regular Strings                      9
  50.    34. Make C Language Strings The Default                                 10
  51.    35. Make Turbo Pascal Strings The Default                               10
  52.    36. Signed Binary Integer As Sort Key                                   10
  53.    37. Turbo Pascal String And Signed Binary Integer                       10
  54.    38. Unsigned Binary Integer As Sort Key                                 11
  55.    39. 80x87 Floating Point Number As Sort Key                             11
  56.    40. BASICA & GWBASIC Floating Point Number As Sort Key                  11
  57.    41. Turbo Pascal Real Number As Sort Key                                11
  58.  
  59.   List Of Various Compiler And Interpreter Numeric Data Types              12
  60.  
  61.  
  62.  
  63.   September 17, 1991           RPSORT Examples                       Page   1
  64.  
  65.  
  66.   Usage:  RPSORT  [/Q]  [/Eerrfile]  [/]?  [inputfile[+inputfile]]
  67.                   [outputfile]  [/A]  [/B]  [/C]  [/D]  [/Fnnnn]  [/N]  [/P]
  68.                   [/R]  [/Td]  [/Z]  [sort key defin. . .]
  69.  
  70.   Sort key defin syntax:  /+ [col] [:len] [A] [C] [F] [I] [M] [P] [R] [T] [U]
  71.  
  72.  
  73.   Suggestion On How To Use This Document
  74.  
  75.     The syntax for RPSORT is simpler than the forbidding usage specification,
  76.     above, might suggest.  There are three kinds of parameters:
  77.  
  78.     . Filespecs. For the input to RPSORT you can have either a single
  79.       filespec or a list of filespecs separated by plus signs.  For the
  80.       output only a single filespec is allowed.
  81.  
  82.     . Switches.  These are a slash followed by a letter indicating the type
  83.       of switch.  Some switches also include a number, filespec or drive.
  84.  
  85.     . Sort key definitions.  These are a slash followed by a plus sign ("/+")
  86.       and one or more attributes which define a sort key.
  87.  
  88.     In this document, I start with the simplest examples and build up to
  89.     examples that include several parameters.  Eventually every type of
  90.     parameter that RPSORT supports appears at least once.
  91.  
  92.     Many of the parameters are only described once or twice when they first
  93.     appear in examples.  Though they may be used in subsequent examples they
  94.     will not be described there.  Therefore, I suggest that the best idea
  95.     would be to scan the examples in order rather than skipping around to
  96.     topics of interest.
  97.  
  98.  
  99.   General Rules For Entry Of Parameters
  100.  
  101.   . All parameters may be entered in upper or lower case as you choose.  As
  102.     far as RPSORT is concerned, there is no difference.
  103.  
  104.   . The parameters may be entered in any sequence except as noted in the
  105.     discussion of some RPSORT examples.
  106.  
  107.   . In the commands below, I separate the parameters with spaces for clarity.
  108.     RPSORT generally accepts spaces between parameters but does not require
  109.     them except as noted in the discussion of some RPSORT examples.
  110.  
  111.  
  112.   Cautionary Note On Specifying The Output File To RPSORT
  113.  
  114.   . If you specify a filespec, for the output, whose path and filename are
  115.     the same as that for an existing file, the latter will be replaced by the
  116.     output from RPSORT.  If this is what you want, fine, but if you don't
  117.     want to lose the existing file then use a different name for the output.
  118.  
  119.  
  120.  
  121.   September 17, 1991           RPSORT Examples                       Page   2
  122.  
  123.  
  124.   Usage:  RPSORT  [/Q]  [/Eerrfile]  [/]?  [inputfile[+inputfile]]
  125.                   [outputfile]  [/A]  [/B]  [/C]  [/D]  [/Fnnnn]  [/N]  [/P]
  126.                   [/R]  [/Td]  [/Z]  [sort key defin. . .]
  127.  
  128.   Sort key defin syntax:  /+ [col] [:len] [A] [C] [F] [I] [M] [P] [R] [T] [U]
  129.  
  130.  
  131.   Examples That Could Be Executed By The DOS SORT
  132.  
  133.     The first five examples are commands that could be executed by DOS SORT
  134.     but RPSORT does them much faster and can do them for much larger files.
  135.  
  136.  
  137.     1. RPSORT is here used as a filter which is the only option for the DOS
  138.        SORT.  No sort key is defined, so the sort key is the entire line.
  139.        The default for RPSORT and the only option for the DOS SORT is that:
  140.  
  141.        . The input is a text file consisting of lines each ending with a CRLF
  142.          (i.e. a carriage return and a line feed.)
  143.        . The sort key is case insensitive.  Lower case letters sort equal to
  144.          upper case letters and foreign letters, punctuation and currency
  145.          symbols sort equal to their American English equivalents.
  146.  
  147.            RPSORT  <MYINPUT.DAT  >C:\MYSORTED.DAT
  148.  
  149.  
  150.     2. No output file is specified, so output goes to the screen.  You must
  151.        specify an input file for RPSORT.  Unlike the DOS SORT, it doesn't
  152.        accept input data from the keyboard.
  153.  
  154.            RPSORT  <MYINPUT.DAT
  155.  
  156.  
  157.     3. The sort key starts at column 12 and consists of the rest of the line.
  158.        This is the only option for the DOS SORT and the default for RPSORT.
  159.        One sort key is listed which is all that the DOS SORT allows.
  160.  
  161.            RPS